<script setup>
import {onMounted, ref} from "vue";
import * as echarts from "echarts";
onMounted(()=>{
  initComputerChart()
})
let totalTodayProfit = ref()
let myChartTotal = ref()
const initComputerChart = () => {
  myChartTotal.value = echarts.init(totalTodayProfit.value);
  let goodsProfit = 335;
  let computerProfit = 234;
  const option = {
    series: [
      {
        type: 'pie',
        data: [
          {
            value: goodsProfit,
            name: '直接访问'
          },
          {
            value: goodsProfit,
            name: '联盟广告'
          },
          {
            value: 1548,
            name: '搜索引擎'
          }
        ]
      }
    ]
  };
  myChartTotal.value.setOption(option);
};
</script>

<template>
  今日总收入
  <div ref="totalTodayProfit" style="width: 400px;height: 300px">

  </div>
</template>

<style scoped>

</style>